package marvin.webapp.audio.client;

import marvin.client.core.SubscriptionClient;
import marvin.webapp.audio.action.AbstractAudioWebAction;

public class MarvinClient extends Thread{
	
	private static MarvinClient instance;
	
	public static MarvinClient startClient(){
		if(instance == null){
			instance = new MarvinClient();
			instance.start();
		}
		
		return instance;
	}
	
	public void run(){
		connect();
	}
	
	public void connect(){
		SubscriptionClient client;
		
		String clientName="Marvin";
		String server = "localhost";
		
		client = new SubscriptionClient(AbstractAudioWebAction.SUBSCRIPTION_PORT, server);
		client.sendId(clientName);
	}
}
